import { createHashRouter, RouteObject } from "react-router"

import AppLayout from "../layout"
import Login from "../views/login"
import Home from "../views/home"
import Goods from "../views/goods"
import User from "../views/user"
import Other from "../views/other"
import Setting from "../views/other/setting"
import Config from "../views/other/config"

const routes: RouteObject[] = [
  {
    path: '/login',
    Component: Login
  },
  {
    path: '/',
    Component: AppLayout,
    children: [
      {
        path: 'home',
        Component: Home
      },
      {
        path: 'goods',
        Component: Goods
      },
      {
        path: 'user',
        Component: User
      },
      {
        path: 'other',
        Component: Other,
        children: [
          {
            path: 'setting',
            Component: Setting
          },
          {
            path: 'config',
            Component: Config
          }
        ]
      }
    ]
  }
]

export default createHashRouter(routes)